﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace d1
{
    public class OrderDetails
    {
        private string id;
        private Customer customer;
        private DateTime orderDate;

        public OrderDetails(string id, Customer customer, DateTime orderDate)
        {
            Id = id;
            Customer = customer;
            OrderDate = orderDate;
        }

        public string Id { get => id; set => id = value; }
        public Customer Customer { get => customer; set => customer = value; }
        public DateTime OrderDate { get => orderDate; set => orderDate = value; }

        public override string ToString()
        {
            return "订单号为 " + Id + " 的订单客户: " + Customer.ToString() + "订购日期：" + OrderDate + "\n";
        }
        public override bool Equals(object? obj)
        {
            OrderDetails details = obj as OrderDetails;
            return details != null && details.Id == Id;
        }
        public override int GetHashCode()
        {
            return int.Parse(Id);
        }
    }
}
